<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="css/reset.css">
    <link rel="stylesheet" href="css/mian1.css">
    <link rel="stylesheet" href="css/header.css">
    <link rel="stylesheet" href="css/bottom.css">
    <style>
        .template{
            display: block;
            width: 262px;
            height: 236px;
            display: none;
        }
    </style>
</head>
<body>
    <header>
        <div class="banner">
            <div class="logo-no1">
                <span>
                    网络全案营销服务提供商
                </span>
            </div>
            <ul>
                <li><a href="">网站首页</a></li>
                <li><a href="">传悦资源</a></li>
                <li><a href="">传悦案例</a></li>
                <li><a href="">传悦服务</a></li>
                <li><a href="">解决方案</a></li>
                <li><a href="">需求提交</a></li>
            </ul>
            <div class="imgs">

            </div>
        </div>
    </header>
    <div class="second">
        <div class="cover">
            <div class="cover-one">
                <span>网站首页</span>&gt;
                <span>传悦案例</span>
            </div>
        </div>
    </div>
    <div class="case">
        <ul class="banner-one">
            <li><a href="">全部</a></li>
            <li><a href="">网站建设</a></li>
            <li><a href="">推广运营</a></li>
            <li><a href="">品牌策划</a></li>
            <li><a href="">网络全案</a></li>
        </ul>
        <div class="case-one">
            <a href="" class="template now">
                <dl>
                    <dt class="imges">
    
                    </dt>
                    <dd class="introduce"></dd>
                    <dd class="kind"></dd>
                </dl>
            </a>
        </div>
        <ul class="number">
            <li><a href="">&lt;</a></li>
            <li><a href="">1</a></li>
            <li><a href="">2</a></li>
            <li><a href="">3</a></li>
            <li><a href="">4</a></li>
            <li><a href="">&gt;</a></li>
        </ul>
    </div>
    <div class="last">
        <div class="last-middle">
            <div class="logo-last"></div>
            <div class="last-right">
                <ul>
                    <li><a href="">关于传悦</a></li>
                    <li><a href="">新闻动态</a></li>
                    <li><a href="">关于传悦</a></li>
                    <li><a href="">联系传悦</a></li>
                    <li><a href="">加入传悦</a></li>
                    <li><a href="">付款账户</a></li>
                </ul>
                <div>
                    Copyright&nbsp;2013&nbsp;创梦网络科技有限责任公司&nbsp;&nbsp;||&nbsp;&nbsp;传悦Chnyoo.cn All Rights Reserved&nbsp;&nbsp;京ICP备12005221号
                </div>
            </div>
        </div>
    </div>
</body>
</html>
<script src="jquery.min.js"></script>
<script>
    let http = new XMLHttpRequest()
    http.open('get','http://127.0.0.1:1000/has')
    http.send()
    http.onreadystatechange = function(){
        if(http.readyState === 4){
            let data = JSON.parse(http.responseText)
            let tem = $(".template")
            let cases = $(".case-one")
            data.forEach((item)=>{
                let temps = tem.clone()
                temps.attr("class","now")
                temps.find(".imges").html(item.img)
                temps.find(".introduce").html(item.introduce)
                temps.find(".kind").html(item.kind)
                temps.appendTo(cases)
                $(".now").attr("href",`mian2.html?id=${item.id}`)
                console.log($(".now").href)
            });
            console.log(data)
        }
    }
</script>